<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Eigen-unsupported: Eigen::MatrixPower&lt; MatrixType &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="eigendoxy.css" rel="stylesheet" type="text/css">
<!--  -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen-unsupported</a>
   &#160;<span id="projectnumber">3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classEigen_1_1MatrixPower.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="classEigen_1_1MatrixPower-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Eigen::MatrixPower&lt; MatrixType &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__MatrixFunctions__Module.html">Matrix functions module</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename MatrixType&gt;<br />
class Eigen::MatrixPower&lt; MatrixType &gt;</h3>

<p>Class for computing matrix powers. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">MatrixType</td><td>type of the base, expected to be an instantiation of the <a class="elRef" href="../classEigen_1_1Matrix.html">Matrix</a> class template.</td></tr>
  </table>
  </dd>
</dl>
<p>This class is capable of computing real/complex matrices raised to an arbitrary real power. Meanwhile, it saves the result of Schur decomposition if an non-integral power has even been calculated. Therefore, if you want to compute multiple (&gt;= 2) matrix powers for the same matrix, using the class directly is more efficient than calling <a class="elRef" href="../classEigen_1_1MatrixBase.html#a7ae6c25e6a94a60e147741e76203a73b">MatrixBase::pow()</a>.</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;unsupported/Eigen/MatrixFunctions&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">using namespace </span><a class="code" href="namespaceEigen.html">Eigen</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main()</div>
<div class="line">{</div>
<div class="line">  <a class="codeRef" href="../group__matrixtypedefs.html#gaf2b40d33e069e1116ce298c91947dab6">Matrix4cd</a> A = <a class="codeRef" href="../classEigen_1_1DenseBase.html#ae814abb451b48ed872819192dc188c19">Matrix4cd::Random</a>();</div>
<div class="line">  MatrixPower&lt;Matrix4cd&gt; Apow(A);</div>
<div class="line"> </div>
<div class="line">  std::cout &lt;&lt; <span class="stringliteral">&quot;The matrix A is:\n&quot;</span> &lt;&lt; A &lt;&lt; <span class="stringliteral">&quot;\n\n&quot;</span></div>
<div class="line">               <span class="stringliteral">&quot;A^3.1 is:\n&quot;</span> &lt;&lt; Apow(3.1) &lt;&lt; <span class="stringliteral">&quot;\n\n&quot;</span></div>
<div class="line">               <span class="stringliteral">&quot;A^3.3 is:\n&quot;</span> &lt;&lt; Apow(3.3) &lt;&lt; <span class="stringliteral">&quot;\n\n&quot;</span></div>
<div class="line">               <span class="stringliteral">&quot;A^3.7 is:\n&quot;</span> &lt;&lt; Apow(3.7) &lt;&lt; <span class="stringliteral">&quot;\n\n&quot;</span></div>
<div class="line">               <span class="stringliteral">&quot;A^3.9 is:\n&quot;</span> &lt;&lt; Apow(3.9) &lt;&lt; std::endl;</div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="ttc" id="aclassEigen_1_1DenseBase_html_ae814abb451b48ed872819192dc188c19"><div class="ttname"><a href="../classEigen_1_1DenseBase.html#ae814abb451b48ed872819192dc188c19">Eigen::DenseBase::Random</a></div><div class="ttdeci">static const RandomReturnType Random()</div></div>
<div class="ttc" id="agroup__matrixtypedefs_html_gaf2b40d33e069e1116ce298c91947dab6"><div class="ttname"><a href="../group__matrixtypedefs.html#gaf2b40d33e069e1116ce298c91947dab6">Matrix4cd</a></div><div class="ttdeci">Matrix&lt; std::complex&lt; double &gt;, 4, 4 &gt; Matrix4cd</div></div>
<div class="ttc" id="anamespaceEigen_html"><div class="ttname"><a href="namespaceEigen.html">Eigen</a></div><div class="ttdoc">Namespace containing all symbols from the Eigen library.</div></div>
</div><!-- fragment --><p> Output: </p><pre class="fragment">The matrix A is:
 (-0.211234,0.680375)   (0.10794,-0.444451)   (0.434594,0.271423) (-0.198111,-0.686642)
   (0.59688,0.566198) (0.257742,-0.0452059)  (0.213938,-0.716795) (-0.782382,-0.740419)
 (-0.604897,0.823295) (0.0268018,-0.270431) (-0.514226,-0.967399)  (-0.563486,0.997849)
 (0.536459,-0.329554)    (0.83239,0.904459)  (0.608354,-0.725537)  (0.678224,0.0258648)

A^3.1 is:
   (2.80575,-0.607662) (-1.16847,-0.00660555)    (-0.760385,1.01461)   (-0.38073,-0.106512)
     (1.4041,-3.61891)     (1.00481,0.186263)   (-0.163888,0.449419)   (-0.388981,-1.22629)
   (-2.07957,-1.58136)     (0.825866,2.25962)     (5.09383,0.155736)    (0.394308,-1.63034)
  (-0.818997,0.671026)  (2.11069,-0.00768024)    (-1.37876,0.140165)    (2.50512,-0.854429)

A^3.3 is:
  (2.83571,-0.238717) (-1.48174,-0.0615217)  (-0.0544396,1.68092) (-0.292699,-0.621726)
    (2.0521,-3.58316)    (0.87894,0.400548)  (0.738072,-0.121242)   (-1.07957,-1.63492)
  (-3.00106,-1.10558)     (1.52205,1.92407)    (5.29759,-1.83562)  (-0.532038,-1.50253)
  (-0.491353,-0.4145)     (2.5761,0.481286)  (-1.21994,0.0367069)    (2.67112,-1.06331)

A^3.7 is:
     (1.42126,0.33362)   (-1.39486,-0.560486)      (1.44968,2.47066)   (-0.324079,-1.75879)
    (2.65301,-1.82427)   (0.357333,-0.192429)      (2.01017,-1.4791)    (-2.71518,-2.35892)
   (-3.98544,0.964861)     (2.26033,0.554254)     (3.18211,-5.94352)    (-2.22888,0.128951)
   (0.944969,-2.14683)      (3.31345,1.66075) (-0.0623743,-0.848324)        (2.3897,-1.863)

A^3.9 is:
 (0.0720766,0.378685) (-0.931961,-0.978624)      (1.9855,2.34105)  (-0.530547,-2.17664)
  (2.40934,-0.265286)  (0.0299975,-1.08827)    (1.98974,-2.05886)   (-3.45767,-2.50235)
    (-3.71666,2.3874)        (2.054,-0.303)   (0.844348,-7.29588)    (-2.59136,1.57689)
   (1.87645,-2.38798)     (3.52111,2.10508)    (0.799055,-1.6122)    (1.93452,-2.44408)
</pre> </div>
<p>Inherits internal::noncopyable.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa1258393dc13acd6e401e000f99b915f"><td class="memTemplParams" colspan="2">template&lt;typename ResultType &gt; </td></tr>
<tr class="memitem:aa1258393dc13acd6e401e000f99b915f"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classEigen_1_1MatrixPower.html#aa1258393dc13acd6e401e000f99b915f">compute</a> (ResultType &amp;res, RealScalar p)</td></tr>
<tr class="memdesc:aa1258393dc13acd6e401e000f99b915f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the matrix power.  <a href="classEigen_1_1MatrixPower.html#aa1258393dc13acd6e401e000f99b915f">More...</a><br /></td></tr>
<tr class="separator:aa1258393dc13acd6e401e000f99b915f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5eb445525601510413b53cd347c44716"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1MatrixPower.html#a5eb445525601510413b53cd347c44716">MatrixPower</a> (const MatrixType &amp;A)</td></tr>
<tr class="memdesc:a5eb445525601510413b53cd347c44716"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="classEigen_1_1MatrixPower.html#a5eb445525601510413b53cd347c44716">More...</a><br /></td></tr>
<tr class="separator:a5eb445525601510413b53cd347c44716"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ad22d156b1a7ff12d6c40a093cd95eb"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classEigen_1_1MatrixPowerParenthesesReturnValue.html">MatrixPowerParenthesesReturnValue</a>&lt; MatrixType &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1MatrixPower.html#a2ad22d156b1a7ff12d6c40a093cd95eb">operator()</a> (RealScalar p)</td></tr>
<tr class="memdesc:a2ad22d156b1a7ff12d6c40a093cd95eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the matrix power.  <a href="classEigen_1_1MatrixPower.html#a2ad22d156b1a7ff12d6c40a093cd95eb">More...</a><br /></td></tr>
<tr class="separator:a2ad22d156b1a7ff12d6c40a093cd95eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a5eb445525601510413b53cd347c44716"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5eb445525601510413b53cd347c44716">&#9670;&nbsp;</a></span>MatrixPower()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1MatrixPower.html">Eigen::MatrixPower</a>&lt; MatrixType &gt;::<a class="el" href="classEigen_1_1MatrixPower.html">MatrixPower</a> </td>
          <td>(</td>
          <td class="paramtype">const MatrixType &amp;&#160;</td>
          <td class="paramname"><em>A</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">A</td><td>the base of the matrix power.</td></tr>
  </table>
  </dd>
</dl>
<p>The class stores a reference to A, so it should not be changed (or destroyed) before evaluation. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aa1258393dc13acd6e401e000f99b915f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa1258393dc13acd6e401e000f99b915f">&#9670;&nbsp;</a></span>compute()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType &gt; </div>
<div class="memtemplate">
template&lt;typename ResultType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classEigen_1_1MatrixPower.html">Eigen::MatrixPower</a>&lt; MatrixType &gt;::compute </td>
          <td>(</td>
          <td class="paramtype">ResultType &amp;&#160;</td>
          <td class="paramname"><em>res</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">RealScalar&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compute the matrix power. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>exponent, a real scalar. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">res</td><td>\( A^p \) where A is specified in the constructor. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a2ad22d156b1a7ff12d6c40a093cd95eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ad22d156b1a7ff12d6c40a093cd95eb">&#9670;&nbsp;</a></span>operator()()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classEigen_1_1MatrixPowerParenthesesReturnValue.html">MatrixPowerParenthesesReturnValue</a>&lt;MatrixType&gt; <a class="el" href="classEigen_1_1MatrixPower.html">Eigen::MatrixPower</a>&lt; MatrixType &gt;::operator() </td>
          <td>(</td>
          <td class="paramtype">RealScalar&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the matrix power. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>exponent, a real scalar. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The expression \( A^p \), where A is specified in the constructor. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="MatrixPower_8h_source.html">MatrixPower.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceEigen.html">Eigen</a></li><li class="navelem"><a class="el" href="classEigen_1_1MatrixPower.html">MatrixPower</a></li>
    <li class="footer">Generated on Thu Apr 21 2022 13:08:00 for Eigen-unsupported by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
